package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.domain.Accident;
import cn.wolfcode.crm.domain.Loss;
import cn.wolfcode.crm.page.PageResult;
import cn.wolfcode.crm.query.AccidentQueryObject;
import cn.wolfcode.crm.service.IAccidentService;
import cn.wolfcode.crm.util.JsonResult;
import cn.wolfcode.crm.util.PermissionName;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("audit")
public class AuditController {

    @Autowired
    private IAccidentService accidentService;

    @RequestMapping("")
    @RequiresPermissions("audit:index")
    @PermissionName("事故审核列表")
    public String index() {
        //audit.jsp页面即可
        return "audit";
    }

    @RequestMapping("list")
    @RequiresPermissions("accident:list")
    @PermissionName("事故审核单")
    @ResponseBody
    public PageResult listAudit(AccidentQueryObject qo) {
        PageResult result=accidentService.queryForAudit(qo);
        return result;
    }



}